package com.example.isoftservice.service.email;

import com.example.isoftservice.pojos.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
public class EmailController {

    @Resource
    private  SystemService service;

    @PostMapping("/mails")
    @ResponseBody
    public Map<String,Object> doMail(@RequestBody User user){
        return service.sendemail(user);
    }
    @PostMapping("/loginByEmail")
    public Map<String,Object> loginByEmail(@RequestBody User user){
        return service.login(user);
    }
}
